import { ApiProperty } from '@nestjs/swagger';
import { IsOptional, IsString, IsNotEmpty } from 'class-validator';
import { PartialType } from '@nestjs/swagger';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';

export class SpecsType_Create_Dto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty({ description: '规格属性类型名称' })
  specsTypeName: string;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '商品ID' })
  platFormId: number;
}

export class SpecsType_FindByPage_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ description: '商品ID' })
  platFormId?: number;
}

export class SpecsType_Update_Dto extends PartialType(SpecsType_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;
}
